const AutoImport = require('unplugin-auto-import/webpack');
const Components = require('unplugin-vue-components/webpack');
const { TDesignResolver } = require('unplugin-vue-components/resolvers');
module.exports = {
  css: {
    loaderOptions: {
      less: {
        // 全局变量文件路径，可根据需要自行调整
        prependData: `@import "@/styles/variables.less";`
      }
    }
  },
  publicPath: "./",
  // 设置lintOnSave为false,禁用eslint。
  lintOnSave: false,
  chainWebpack: config => {
    config.module.rules.delete('eslint');
    config.module
      .rule('vue')
      .use('vue-loader')
      .tap(options => {
        options.compilerOptions = {
          ...options.compilerOptions,
          isCustomElement: tag => tag.startsWith('easy-')
        }
        return options
      })
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [TDesignResolver({
          library: 'vue-next'
        })],
      }),
      Components({
        resolvers: [TDesignResolver({
          library: 'vue-next'
        })],
      }),
    ],
  }
  ,
}